/**
 * 
 */
package neptune.manager.storage;

import java.io.File;

import neptune.manager.utils.DebugLog;

/**
 * @author Roberto Bifulco [RobertoBifulco.it] [info@robertoBifulco.it]
 * 
 */
public class XMLTopologyStorageFactory implements TopologyStorageFactory {

	private String filepath;

	public XMLTopologyStorageFactory(String filepath) {
		if (!filepath.endsWith(File.separator)) {
			filepath += File.separator;
		}
		this.filepath = filepath;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * neptune.manager.storage.TopologyStorageFactory#getTopologyStorage(java
	 * .lang.String)
	 */
	@Override
	public TopologyStorage getTopologyStorage(String topologyName) {
		DebugLog.printDetailedLog("Creating XMLTopologyStorage",
				XMLTopologyStorageFactory.class.getSimpleName());
		return new XMLTopologyStorage(new File(filepath + topologyName
				+ ".topology.xml"), new File(filepath + topologyName
				+ ".topology.xml.temp"));
	}

}
